﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sinacor.UI.Bovespa.Parametro.Communication.Bovespa.Cliente.Correspondente;
using Sinacor.Infra.UI.Common;


//Task : 5435
//Data : 02/03/2009
//Autor: Andre
/// <summary>
/// Translator da  Model para o Data Contract
/// </summary>
namespace Sinacor.UI.Bovespa.Parametro.Communication.Translator.ModelToDataContract
{
    public class Correspondente
    {
        public List<CorrespondenteResponse> ToCorrespondenteRequest(ModelCollection<UI.Bovespa.Parametro.Model.Correspondente> from)
        {
            List<CorrespondenteResponse> to = new List<CorrespondenteResponse>();

            foreach (UI.Bovespa.Parametro.Model.Correspondente item in from)
            {
                to.Add(ToCorrespondenteRequest(item));
            }

            return to;

        }

        private CorrespondenteResponse ToCorrespondenteRequest(Sinacor.UI.Bovespa.Parametro.Model.Correspondente from)
        {
            CorrespondenteResponse to = new CorrespondenteResponse();

            to.Codigo = from.Codigo;
            to.CodigoMembroBovespa = from.CodigoMembroBovespa;
            to.IndicadorBroker = from.IndicadorBroker;
            to.Nome = from.Nome;
            to.NomeResumidoCorrespondente = from.NomeResumidoCorrespondente;
            to.PercentualComissao = from.PercentualComissao;
            return to;

        }

     //  public   Model.Parameter.FiltroCorrespondente ToFiltroCorrespondenteRequest 

    }
}
